package com.zaoniao.enstudy.api.dto;

import com.zaoniao.enstudy.domain.entity.Vocabulary;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import javax.validation.constraints.NotBlank;

@Data
@Schema(name = "新增词汇表入参对象")
public class VocabularyAddDto {

    @Schema(description = "用户唯一标识OpenId", name = "userId")
    @NotBlank(message = "用户Id不能为空")
    private String userId;

    @Schema(description = "词汇表名称", name = "vocabularyName")
    @NotBlank(message = "词汇表名称不能为空")
    private String vocabularyName;


    @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
    public interface Converter {

        VocabularyAddDto.Converter INSTANCE = Mappers.getMapper(VocabularyAddDto.Converter.class);

        Vocabulary dto2do(VocabularyAddDto vocabularyAddDto);

    }
}
